package com.lagou.sqlSession;

import com.lagou.pojo.Configuration;
import com.lagou.pojo.MapperStatement;

import java.util.List;

/**
 * SqlSession提供了操作数据库的API，但是真正执行SQL的是Executor组件，
 * Executor接口中定义了对数据库的增删改查方法
 *
 * @author YiYa
 * @since 2020-11-08 下午 04:05
 */
public interface Executor {
    // 查询
    public <E> List<E> query(Configuration configuration, MapperStatement mapperStatement, Object... params) throws Exception;

    public Integer insert(Configuration configuration, MapperStatement mapperStatement, Object... params) throws Exception;

    public Integer update(Configuration configuration, MapperStatement mapperStatement, Object... params) throws Exception;

    public Integer delete(Configuration configuration, MapperStatement mapperStatement, Object... params) throws Exception;
}
